from lib.cuckoo.common.abstracts import Signature


class TamperInternetSetting(Signature):
    name = "tamper_internet_setting"
    description = "Attempt to obtain registry information related to Internet settings and tamper with it."
    severity = 3
    categories = ["reg"]
    authors = ["xuhy"]
    minimum = "2.0"

    regkeys_re = [
        ".*\\\\(SOFTWARE|Software)\\\\(Wow6432Node\\\\|WOW6432Node\\\\|Policies\\\\)?Microsoft\\\\Windows\\\\CurrentVersion\\\\Internet Settings",
    ]

    def on_complete(self):
        for indicator in self.regkeys_re:
            for regkey in self.check_key(pattern=indicator, regex=True, all=True):
                self.mark_ioc("registry", regkey)

        return self.has_marks()
